package cn.net.dpi.core.annotation;

import cn.net.dpi.core.validation.IsEnumValidator;
import cn.net.dpi.core.validation.StartAndStopTimeValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 校验起始时间是否小于截止时间，目前仅支持 {@link java.util.Date}、{@link java.time.LocalDateTime}
 * {@link IsEnumValidator}
 * @author dzcr
 */
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = { StartAndStopTimeValidator.class })
public @interface StartAndStopTime {

    String startTimeFiledName() default "startTime";

    String endTimeFiledName() default "endTime";

    String message() default "起始、截止时间必须是合法时间且起始时间必须小于截止时间";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

}
